home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 3.8 KB | 147 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Frame.cpp
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FRAME_H
- #include "Frame.h"
- #endif
-
- #ifndef PART_H
- #include "Part.h"
- #endif
-
- #ifndef DIALOG_H
- #include "Dialog.h"
- #endif
-
- #ifndef DEFINES_K
- #include "Defines.k"
- #endif
-
- // ----- Framework Includes -----
-
- #ifndef FWUTIL_H
- #include "FWUtil.h"
- #endif
-
- #ifndef FWCONTXT_H
- #include "FWContxt.h"
- #endif
-
- #ifndef FWIDLE_H
- #include "FWIdle.h"
- #endif
-
- #ifndef FWITERS_H
- #include "FWIters.h"
- #endif
-
- #ifndef FWRECSHP_H
- #include "FWRecShp.h"
- #endif
-
- // ----- PPob View Support -----
-
- #if FW_PPOB_VIEWS
- #include "FWPPobRd.h"
- #endif
-
- // ----- MacApp View Support -----
-
- #if FW_MACAPP_VIEWS
- #include "FWMARead.h"
- #endif
-
- //========================================================================================
- // Runtime informations
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment viewtester
- #endif
-
- //========================================================================================
- // CLASS CViewTesterFrame
- //========================================================================================
-
- FW_DEFINE_AUTO(CViewTesterFrame)
-
- //----------------------------------------------------------------------------------------
- // CViewTesterFrame::CViewTesterFrame
- //----------------------------------------------------------------------------------------
-
- CViewTesterFrame::CViewTesterFrame(Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, FW_CPart* part) :
- FW_CFrame(ev, odFrame, presentation, part),
- fPart(part)
- {
- // Add an idler to see the caret blink in text-edit views
- fIdler = FW_NEW(FW_CIdler, (this, 15));
- fIdler->RegisterIdle(ev);
-
- FW_END_CONSTRUCTOR
- }
-
- //----------------------------------------------------------------------------------------
- // CViewTesterFrame::~CViewTesterFrame
- //----------------------------------------------------------------------------------------
-
- CViewTesterFrame::~CViewTesterFrame()
- {
- FW_START_DESTRUCTOR
-
- delete fIdler;
-
- // Must tell the part!
- ((CViewTesterPart*)fPart)->ResetTestFrame();
- }
-
- //----------------------------------------------------------------------------------------
- // CViewTesterFrame::CreateSubViews
- //----------------------------------------------------------------------------------------
-
- void CViewTesterFrame::CreateSubViews(Environment* ev)
- {
- // This is called the first time the frame is created.
-
- CViewTesterPart* part = (CViewTesterPart*) GetPart(ev);
- FW_PlatformError error;
-
- if (part->UsingMacApp())
- error = FW_CMacAppReader::CreateSubViewsFromMacAppResource(ev,
- part->GetTestViewID(),
- this, // frame is root view
- 0, // don't use any receiver
- FW_CMacAppReader::kCurrentResFile,
- part->HasWarningsOn(ev));
- else
- error = FW_CPPobReader::CreateSubViewsFromPPobResource(ev,
- part->GetTestViewID(),
- this,
- 0,
- FW_CPPobReader::kCurrentResFile,
- part->HasWarningsOn(ev));
- part->CheckForError(ev, error);
- }
-
- //----------------------------------------------------------------------------------------
- // CViewTesterFrame::Draw
- //----------------------------------------------------------------------------------------
-
- void CViewTesterFrame::Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape)
- {
- FW_CViewContext vc(ev, this, odFacet, invalidShape);
-
- FW_CRect rect;
- vc.GetClipRect(rect);
-
- // Keep a purple background for the frame to make subviews more visible
- FW_CRectShape::RenderRect(vc, rect, FW_kFill, FW_CColor(204, 204, 255));
- }
-
-
-